﻿<a href="#/" class="btn btn-info">Back</a>
<div class="messages">
    <div class="message row">
        <div class="title col-md-10">
            {{ topic.title }}
        </div>
        <div class="date col-md-2">{{topic.created | date:"medium"}}</div>
        <div class="contents col-md-12">
            {{topic.body}}
        </div>
        <div class="replies col-md-12" ng-repeat="r in topic.replies">
            <div class="reply">
                <div class="created pull-right">{{r.created| date:"medium"}}</div>
                <div class="content">
                    {{r.body}}
                </div>
            </div>
        </div>
    </div>
    <h3>Add Reply</h3>
    <form name="newReplyForm" novalidate data-ng-submit="addReply()">
        <fieldset>
        <div class="col-md-pull-3">
            <label for="body" class="col-md-pull-1">Body</label>
            <br />
            <textarea name="body" rows="5" cols="30" ng-model="newReply.body" required ng-minlength="15"/>
            <span class="error" ng-show="newReplyForm.body.$error.required">*</span>
            <span class="error" ng-show="newReplyForm.body.$error.minlength">Minimum 15 character</span>
        </div>
        <div>
            <input type="submit" class="btn btn-default btn-sm" value="save" ng-disabled="newReplyForm.$invalid" />
             </div>
        </fieldset>
    </form>
    </div>
